Skip to main content

Import

Sell Modal

Usage

The useSellModal hook provides a convenient way to manage the sell modal interface for accepting offers on collectibles. This modal is specifically used when a user wants to sell their collectible to an existing offer (bid) on the marketplace.
Make sure you have followed the Getting Started guide to get the collection address and chainId.

Basic Example

This example uses the useBalanceOfCollectible hook from marketplace-sdk to verify ownership before showing the sell modal.

Parameters

The hook accepts an optional callbacks object with the following properties:

Return Type

The hook returns an object with the following methods:

Methods

show

(args: ShowSellModalArgs) => void Opens the sell modal with the specified parameters to accept an offer.

close

() => void Closes the sell modal.

Notes

The useSellModal hook provides a convenient way to manage the sell modal interface for accepting offers on collectibles. It handles:
  • Opening and closing the modal
  • Managing the sale transaction flow state
  • Token approval steps (if required)
  • Transaction execution and signature steps
  • Error handling and success callbacks
  • Support for different marketplace types
  • Integration with WaaS (Wallet as a Service) fee options

Prerequisites

Before using this hook, ensure:
  1. User Authentication: The user must be connected with a wallet
  2. Ownership Verification: Use hooks like useBalanceOfCollectible to verify the user owns the collectible
  3. Valid Offer: Ensure there’s a valid offer (Order object) to accept